package com.yanqu.road.server.timer;

import com.yanqu.road.server.manger.manor.ManorMgr;
import com.yanqu.road.utils.executor.GeneralTask;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/**
 * @author ：zfr
 * @date ：2021/10/23 0:02
 */
public class ManorWeatherChangeTask extends GeneralTask {
    private Logger logger = LogManager.getLogger(ManorWeatherChangeTask.class.getName());
    private boolean isRun = false;
    @Override
    public void doRun() {
        if (!isRun) {
            isRun = true;
            try {
                ManorMgr.checkWeatherChange();
            } catch (Exception e){
                logger.error("ManorWeatherChangeTask task error:", e);
            }
            isRun = false;
        }
    }
}
